import { articles } from "@/api/index.js";
export default {
  namespaced: true,
  state: {
    infolist: [],
  },
  mutations: {
    SETINFOLIST(s, val) {
      s.infolist = val;
      // console.log(s.infolist);
    },
  },
  actions: {
    async getInfoList({ commit }, id) {
      const {
        data: { data },
      } = await articles(id);
      // console.log(data.results);
      commit("SETINFOLIST", data.results);
    },
  },
};
